﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using BUS;
using DevExpress.XtraReports.UI;
namespace GUI
{
    public partial class uc_ThongKeTon : DevExpress.XtraEditors.XtraUserControl
    {
        public uc_ThongKeTon()
        {
            InitializeComponent();
        }
        MobileBL mobile = new MobileBL();
        AccessoryBL acc = new AccessoryBL();    
        private void btnThongKe_Click(object sender, EventArgs e)
        {
         
            if (txtNgayLapTK.Text != "")
            {

                String month = txtNgayLapTK.DateTime.Month.ToString();
                gridThongKeTon.DataSource = mobile.Mobile_SelectALL();
                gridControl1.DataSource = acc.Accessory_SelectALL();
            }
            else
                MessageBox.Show("Vui lòng chọn ngày thống kê", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Stop);

        }

        private void gridThongKeTon_Click(object sender, EventArgs e)
        {

        }

        private void labelControl10_Click(object sender, EventArgs e)
        {

        }

        private void txtTongTon_EditValueChanged(object sender, EventArgs e)
        {

        }

        private void btnInTK_Click(object sender, EventArgs e)
        {
            if (txtNgayLapTK.Text != "")
            {
                rp_ThongKeDTTon.thangtk = txtNgayLapTK.DateTime.Month.ToString();
                rp_ThongKeDTTon.ngaylap = txtNgayLapTK.Text;
                rp_ThongKeDTTon rp = new rp_ThongKeDTTon();
                ReportPrintTool printTool = new ReportPrintTool(rp);
                printTool.ShowPreviewDialog();
            }
            else
                MessageBox.Show("Vui lòng chọn ngày thống kê", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Stop);

        }

        private void btnHuy_Click(object sender, EventArgs e)
        {
            gridThongKeTon.DataSource = null;
            gridControl1.DataSource = null;
        }

        private void simpleButton1_Click(object sender, EventArgs e)
        {
            if (txtNgayLapTK.Text != "")
            {
                rp_ThongKeTonPK.thangtk = txtNgayLapTK.DateTime.Month.ToString();
                rp_ThongKeTonPK.ngaylap = txtNgayLapTK.Text;
                rp_ThongKeTonPK rp = new rp_ThongKeTonPK();
                ReportPrintTool printTool = new ReportPrintTool(rp);
                printTool.ShowPreviewDialog();
            }
            else
                MessageBox.Show("Vui lòng chọn ngày thống kê", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Stop);
        }


 
    }
}
